Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have

    Adobe Firefly can take your random clips and and stitch them together like an expert

    Everything Samsung announced at the Galaxy S26 launch event

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Tensions between the Pentagon and AI giant Anthropic reach a boiling point

      February 21, 2026

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026
    • Business

      How Smarsh built an AI front door for regulated industries — and drove 59% self-service adoption

      February 24, 2026

      Where MENA CIOs draw the line on AI sovereignty

      February 24, 2026

      Ex-President’s shift away from Xbox consoles to cloud gaming reportedly caused friction

      February 24, 2026

      Gartner: Why neoclouds are the future of GPU-as-a-Service

      February 21, 2026

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026
    • Crypto

      Crypto Market Rebound Wipes Out Nearly $500 Million in Short Positions

      February 26, 2026

      Ethereum Climbs Above $2000: Investors Step In With Fresh Accumulation

      February 26, 2026

      Mutuum Finance (MUTM) Prepares New Feature Expansion for V1 Protocol

      February 26, 2026

      Bitcoin Rebounds Toward $70,000, But Is It a Momentary Relief or Slow Bull Run Signal?

      February 26, 2026

      IMF: US Inflation Won’t Hit Fed Target Until 2027, Delaying Rate Cuts

      February 26, 2026
    • Technology

      Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have

      February 26, 2026

      Adobe Firefly can take your random clips and and stitch them together like an expert

      February 26, 2026

      Everything Samsung announced at the Galaxy S26 launch event

      February 26, 2026

      You can now make Alexa match your mood so every conversation feels just right

      February 26, 2026

      NASA astronaut who suffered serious medical issue on ISS steps forward

      February 26, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Hello-World iOS App in Assembly
    Technology

    Hello-World iOS App in Assembly

    TechAiVerseBy TechAiVerseOctober 30, 2025No Comments4 Mins Read3 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Hello-World iOS App in Assembly
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Hello-World iOS App in Assembly


    .global _main
    .extern _putchar
    .align 4
    _main:
    ; prolog; save fp,lr,x19
    stp x29, x30, [sp, #–0x20]!
    str x19, [sp, #0x10]
    mov x29, sp
    ; make space for 2 dword local vars
    sub sp, sp, #0x10
    ; save argc/argv
    stp x0, x1, [sp]
    ; create autorelease pool and save into x19
    bl _objc_autoreleasePoolPush
    mov x19, x0
    ; initialize app delegate class
    bl initAppDelegate
    ; create CFString with delegate class name
    mov x0, 0
    adrp x1, str_AppDelegate@PAGE
    add x1, x1, str_AppDelegate@PAGEOFF
    mov x2, 0x0600 ; kCFStringEncodingASCII
    bl _CFStringCreateWithCString
    ; x0 = UIApplicationMain(argc, argv, nil, CFSTR(“AppDelegate”));
    mov x3, x0
    ldr x0, [sp]
    ldr x1, [sp, #0x8]
    mov x2, #0
    bl _UIApplicationMain
    mov x7, x0 ; save retval
    ; pop autorelease pool
    mov x0, x19
    bl _objc_autoreleasePoolPop
    ; epilog
    ; restore stack pointer
    add sp, sp, 0x10
    ; restore saved registers
    ldr x19, [sp, #0x10]
    ldp x29, x30, [sp], #0x20
    ; get retval
    mov x0, x7
    ret
    initAppDelegate:
    ; prolog; save fp,lr,x20
    stp x29, x30, [sp, #–0x20]!
    str x20, [sp, #0x10]
    mov x29, sp
    ; Class c = objc_allocateClassPair(objc_getClass(“NSObject”), “AppDelegate”, 0);
    adrp x0, str_NSObject@PAGE
    add x0, x0, str_NSObject@PAGEOFF
    bl _objc_getClass
    adrp x1, str_AppDelegate@PAGE
    add x1, x1, str_AppDelegate@PAGEOFF
    mov x2, 0
    bl _objc_allocateClassPair
    ; save the class since we’ll clobber x0 several times
    mov x20, x0
    ; class_addProtocol(c, objc_getProtocol(“UIApplicationDelegate”));
    adrp x0, str_UIAppDelegate@PAGE
    add x0, x0, str_UIAppDelegate@PAGEOFF
    bl _objc_getProtocol
    mov x1, x0
    mov x0, x20
    bl _class_addProtocol
    ; class_addMethod(c, S(“application:didFinishLaunchingWithOptions:”), didFinishLaunching, “B@:@@”);
    adrp x0, str_didFinishLaunchingSel@PAGE
    add x0, x0, str_didFinishLaunchingSel@PAGEOFF
    bl _sel_getUid
    mov x1, x0
    mov x0, x20
    adr x2, didFinishLaunching
    adrp x3, str_typestr@PAGE
    add x3, x3, str_typestr@PAGEOFF
    bl _class_addMethod
    ; objc_registerClassPair(c);
    mov x0, x20
    bl _objc_registerClassPair
    ; epilog
    ldr x20, [sp, #0x10]
    ldp x29, x30, [sp], #0x20
    ret
    ; parameters:
    ; x0: self
    ; x1: _sel
    ; x2: application
    ; x3: launchOptions
    didFinishLaunching:
    ; prolog, save fp, lr, x19-x22
    stp x29, x30, [sp, #–0x30]!
    stp x19, x20, [sp, #0x10]
    stp x21, x22, [sp, #0x20]
    mov x29, sp
    sub sp, sp, 0x20
    ; x19 = @selector(mainScreen)
    adrp x0, str_mainScreen@PAGE
    add x0, x0, str_mainScreen@PAGEOFF
    bl _sel_getUid
    mov x19, x0
    ; objc_getClass(“UIScreen”)
    adrp x0, str_UIScreen@PAGE
    add x0, x0, str_UIScreen@PAGEOFF
    bl _objc_getClass
    ; x20 = [UIScreen mainScreen]
    mov x1, x19
    bl _objc_msgSend
    mov x20, x0
    ; x19 is now free
    ; x1 = @selector(bounds)
    adrp x0, str_bounds@PAGE
    add x0, x0, str_bounds@PAGEOFF
    bl _sel_getUid
    mov x1, x0
    ; [x20 bounds]
    mov x0, x20
    bl _objc_msgSend
    stp d0, d1, [sp]
    stp d2, d3, [sp, #0x10]
    ; x19 = @selector(initWithFrame:)
    adrp x0, str_initWithFrame@PAGE
    add x0, x0, str_initWithFrame@PAGEOFF
    bl _sel_getUid
    mov x19, x0
    ; x0 = UIWindow
    adrp x0, str_UIWindow@PAGE
    add x0, x0, str_UIWindow@PAGEOFF
    bl _objc_getClass
    ; x0 = class_createInstance(x0)
    mov x1, #0x0
    bl _class_createInstance
    ; x0 now has the instance
    ; x20 = [x0 initWithFrame:d]
    mov x1, x19 ;initWithFrame
    ldp d0, d1, [sp]
    ldp d2, d3, [sp, #0x10]
    bl _objc_msgSend
    mov x20, x0
    ; x19 = @selector(init)
    adrp x0, str_init@PAGE
    add x0, x0, str_init@PAGEOFF
    bl _sel_getUid
    mov x19, x0
    ; x0 = UIViewController
    adrp x0, str_UIViewController@PAGE
    add x0, x0, str_UIViewController@PAGEOFF
    bl _objc_getClass
    ; x0 = class_createInstance(UIViewController)
    mov x1, #0x0
    bl _class_createInstance
    ; x0 now has the instance
    ; x21 = [x0 init]
    mov x1, x19 ;init
    bl _objc_msgSend
    mov x21, x0
    ; x19 = @selector(yellowColor)
    adrp x0, str_yellowColor@PAGE
    add x0, x0, str_yellowColor@PAGEOFF
    bl _sel_getUid
    mov x19, x0
    ; x22 = [UIColor yellowColor]
    adrp x0, str_UIColor@PAGE
    add x0, x0, str_UIColor@PAGEOFF
    bl _objc_getClass
    mov x1, x19
    bl _objc_msgSend
    mov x22, x0
    ; x19 = @selector(setBackgroundColor:)
    adrp x0, str_setBackgroundColor@PAGE
    add x0, x0, str_setBackgroundColor@PAGEOFF
    bl _sel_getUid
    mov x19, x0
    ; x1 = @selector(view)
    adrp x0, str_view@PAGE
    add x0, x0, str_view@PAGEOFF
    bl _sel_getUid
    mov x1, x0
    ; x0 = [[controller view] setBackgroundColor: x22];
    mov x0, x21
    bl _objc_msgSend
    mov x1, x19
    mov x2, x22
    bl _objc_msgSend
    adrp x0, str_setRoot@PAGE
    add x0, x0, str_setRoot@PAGEOFF
    bl _sel_getUid
    mov x1, x0
    ; [window setRootViewController:viewController]
    mov x0, x20
    mov x2, x21
    bl _objc_msgSend
    ; [x20 makeKeyAndVisible]
    adrp x0, str_makeKeyAndVisible@PAGE
    add x0, x0, str_makeKeyAndVisible@PAGEOFF
    bl _sel_getUid
    mov x1, x0
    mov x0, x20
    bl _objc_msgSend
    ; return YES
    mov x0, #0x1
    ; epilog
    add sp, sp, 0x20
    ldp x19, x20, [sp, #0x10]
    ldp x21, x22, [sp, #0x20]
    ldp x29, x30, [sp], #0x30
    ret
    .data
    str_NSObject: .asciz “NSObject”
    str_AppDelegate: .asciz “AppDelegate”
    str_UIAppDelegate: .asciz “UIApplicationDelegate”
    str_UIScreen: .asciz “UIScreen”
    str_UIWindow: .asciz “UIWindow”
    str_UIViewController: .asciz “UIViewController”
    str_UIColor: .asciz “UIColor”
    str_typestr: .asciz “B@:@@”
    str_didFinishLaunchingSel: .asciz “application:didFinishLaunchingWithOptions:”
    str_mainScreen: .asciz “mainScreen”
    str_bounds: .asciz “bounds”
    str_initWithFrame: .asciz “initWithFrame:”
    str_makeKeyAndVisible: .asciz “makeKeyAndVisible”
    str_init: .asciz “init”
    str_view: .asciz “view”
    str_setBackgroundColor: .asciz “setBackgroundColor:”
    str_yellowColor: .asciz “yellowColor”
    str_setRoot: .asciz “setRootViewController:”
    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleIRCd service (2024)
    Next Article Agentic AI is all about the context — engineering, that is
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have

    February 26, 2026

    Adobe Firefly can take your random clips and and stitch them together like an expert

    February 26, 2026

    Everything Samsung announced at the Galaxy S26 launch event

    February 26, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025693 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025279 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025160 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025122 Views
    Don't Miss
    Technology February 26, 2026

    Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have

    Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have The…

    Adobe Firefly can take your random clips and and stitch them together like an expert

    Everything Samsung announced at the Galaxy S26 launch event

    You can now make Alexa match your mood so every conversation feels just right

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Now Nudge is one of the coolest Galaxy S26 features your iPhone doesn’t have

    February 26, 20262 Views

    Adobe Firefly can take your random clips and and stitch them together like an expert

    February 26, 20262 Views

    Everything Samsung announced at the Galaxy S26 launch event

    February 26, 20261 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.