Close Menu

    Subscribe to Updates

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

    What's Hot

    New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor

    Technology innovation drives accountancy job changes

    UK investment bank IT outages cost £600k an hour

    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

      State and local opposition to new data centers is gaining steam, study shows

      November 15, 2025

      Amazon to lay off 14,000 corporate employees

      October 29, 2025

      Elon Musk launches Grokipedia as an alternative to ‘woke’ Wikipedia

      October 29, 2025

      Fears of an AI bubble are growing, but some on Wall Street aren’t worried just yet

      October 18, 2025

      The sleeper issue that could play a huge role in Virginia and New Jersey — and the midterms

      October 16, 2025
    • Business

      Government faces questions about why US AWS outage disrupted UK tax office and banking firms

      October 23, 2025

      Amazon’s AWS outage knocked services like Alexa, Snapchat, Fortnite, Venmo and more offline

      October 21, 2025

      SAP ECC customers bet on composable ERP to avoid upgrading

      October 18, 2025

      Revenue generated by neoclouds expected to exceed $23bn in 2025, predicts Synergy

      October 15, 2025

      You can now try Fortnite directly in Discord

      October 8, 2025
    • Crypto

      Think BlackRock Is Bullish on Bitcoin? Arthur Hayes Says They’re Not, Here’s Why

      November 17, 2025

      3 Altcoins To Watch In The Third Week Of November 2025

      November 17, 2025

      MicroStrategy and BitMine Strike Together — Tom Lee Says the Mania Awaits

      November 17, 2025

      Cboe Unveils First US Perpetual-Style Bitcoin and Ether Continuous Futures

      November 17, 2025

      FIRO’cious Price Rally Shows No Signs of Slowing — Can It Extend Beyond $10?

      November 17, 2025
    • Technology

      New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor

      November 17, 2025

      Technology innovation drives accountancy job changes

      November 17, 2025

      UK investment bank IT outages cost £600k an hour

      November 17, 2025

      Data retention in the UK: How long should you keep data?

      November 17, 2025

      Salesforce: CIOs closer to the bridge than ever due to agentic AI

      November 17, 2025
    • 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 Read2 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

    New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor

    November 17, 2025

    Technology innovation drives accountancy job changes

    November 17, 2025

    UK investment bank IT outages cost £600k an hour

    November 17, 2025
    Leave A Reply Cancel Reply

    Top Posts

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

    April 22, 2025395 Views

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

    July 31, 2025102 Views

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

    April 14, 202575 Views

    Is Libby Compatible With Kobo E-Readers?

    March 31, 202555 Views
    Don't Miss
    Technology November 17, 2025

    New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor

    New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor Key…

    Technology innovation drives accountancy job changes

    UK investment bank IT outages cost £600k an hour

    Data retention in the UK: How long should you keep data?

    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

    New EU Chat Control Proposal Moves Forward – Privacy Experts See a Dangerous Backdoor

    November 17, 20251 Views

    Technology innovation drives accountancy job changes

    November 17, 20250 Views

    UK investment bank IT outages cost £600k an hour

    November 17, 20251 Views
    Most Popular

    Xiaomi 15 Ultra Officially Launched in China, Malaysia launch to follow after global event

    March 12, 20250 Views

    Apple thinks people won’t use MagSafe on iPhone 16e

    March 12, 20250 Views

    French Apex Legends voice cast refuses contracts over “unacceptable” AI clause

    March 12, 20250 Views
    © 2025 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.