k.
this is the original source made from NASM
~~~~~~~~~
;
; sp4ce.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8]
; 10/6/2021
;
; nasm <dash>f win32 sp4ce.asm
; link sp4ce.obj /subsystem:console /defaultlib:msvcrt.lib /entry:m
;
global m
extern _printf
section .text
m:mov al,10
mov bl,45
z:lea edx,a
mov cx,491
r:cmp byte[edx],bl
je s
jmp u
s:mov byte[edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';-; sp4ce.asm-;-; alCoPaUL [GIMO][As][aBrA][NPA][b8]-; 10/6/2021-;-; nasm <dash>f win32 sp4ce.asm-; link sp4ce.obj /subsystem:console /defaultlib:msvcrt.lib /entry:m-;-global m-extern _printf-section .text-m:mov al,10-mov bl,45-z:lea edx,a-mov cx,491-r:cmp byte[edx],bl-je s-jmp u-s:mov byte[edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0
~~~~~~~~~~~~~
this is the source generated from IDA..
;
; +-------------------------------------------------------------------------+
; | This file was generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2019 Hex-Rays, <support@hex-rays.com> |
; | License info: 48-256C-4840-25 |
; | Team-IRA Release [PUBLIC] ,v1.0 |
; +-------------------------------------------------------------------------+
;
; Input SHA256 : 15AFA3253DA6552C06CF72B15E59D8E7FB98F58D99C0A21F3B6BA529C535165E
; Input MD5 : 9A87262B71B81E2FCD380239CBB560A2
; Input CRC32 : 010A3443
; File Name : C:\Users\IWAYWarrior\Downloads\Project159_Windows11_NASM_VS2029\e\et\sp4ce.exe
; Format : Portable executable for 80386 (PE)
; Imagebase : 400000
; Timestamp : 616720C4 (Wed Oct 13 18:09:08 2021)
; Section 1. (virtual address 00001000)
; Virtual size : 0000004D ( 77.)
; Section size in file : 00000200 ( 512.)
; Offset to raw data for section: 00000400
; Flags 60000020: Text Executable Readable
; Alignment : default
.686p
.mmx
.model flat
; Segment type: Pure code
; Segment permissions: Read/Execute
_text segment para public 'CODE' use32
assume cs:_text
;org 401000h
assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing
public start
start proc near
mov al, 0Ah
mov bl, 2Dh ; '-'
loc_401004:
lea edx, aSp4ceAsmAlcopa ; ";-; sp4ce.asm-;-; alCoPaUL [GIMO][As][a"...
mov cx, 1EBh
loc_40100E:
cmp [edx], bl
jz short loc_401014
jmp short loc_401016
loc_401014:
mov [edx], al
loc_401016:
inc edx
dec cx
cmp cx, 0
jnz short loc_40100E
push offset aSp4ceAsmAlcopa ; ";-; sp4ce.asm-;-; alCoPaUL [GIMO][As][a"...
push offset Format ; "%s"
call printf
mov al, 0Ah
cmp bl, 2Dh ; '-'
xchg al, bl
jz short loc_401004
push offset a27h0 ; ",27h,0"
push offset Format ; "%s"
call printf
retn
start endp ; sp-analysis failed
; [00000006 BYTES: COLLAPSED FUNCTION printf. PRESS CTRL-NUMPAD+ TO EXPAND]
align 200h
dd 380h dup(?)
_text ends
; Section 2. (virtual address 00002000)
; Virtual size : 00000160 ( 352.)
; Section size in file : 00000200 ( 512.)
; Offset to raw data for section: 00000600
; Flags 40000040: Data Readable
; Alignment : default
;
; Imports from MSVCR100.dll
;
; Segment type: Externs
; _idata
; int printf(const char *const Format, ...)
extrn __imp_printf:dword
; Debug Directory entries
; Segment type: Pure data
; Segment permissions: Read
_rdata segment para public 'DATA' use32
assume cs:_rdata
;org 402008h
dd 0 ; Characteristics
dd 616720C4h ; TimeDateStamp: Wed Oct 13 18:09:08 2021
dw 0 ; MajorVersion
dw 0 ; MinorVersion
dd 0Dh ; Type: IMAGE_DEBUG_TYPE_POGO
dd 0DCh ; SizeOfData
dd rva unk_40203C ; AddressOfRawData
dd 63Ch ; PointerToRawData
db 18h
db 0
db 0
db 0
db 0
db 80h ; €
db 0
db 80h ; €
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
; Debug information (IMAGE_DEBUG_TYPE_POGO)
unk_40203C db 0
db 0
db 0
db 0
db 0
db 10h
db 0
db 0
db 47h ; G
db 0
db 0
db 0
db 2Eh ; .
db 74h ; t
db 65h ; e
db 78h ; x
db 74h ; t
db 0
db 0
db 0
db 47h ; G
db 10h
db 0
db 0
db 6
db 0
db 0
db 0
db 2Eh ; .
db 74h ; t
db 65h ; e
db 78h ; x
db 74h ; t
db 24h ; $
db 6Dh ; m
db 6Eh ; n
db 0
db 0
db 0
db 0
db 0
db 20h
db 0
db 0
db 8
db 0
db 0
db 0
db 2Eh ; .
db 69h ; i
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 35h ; 5
db 0
db 0
db 0
db 0
db 8
db 20h
db 0
db 0
db 1Ch
db 0
db 0
db 0
db 2Eh ; .
db 72h ; r
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 0
db 0
db 24h ; $
db 20h
db 0
db 0
db 18h
db 0
db 0
db 0
db 2Eh ; .
db 72h ; r
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 76h ; v
db 6Fh ; o
db 6Ch ; l
db 74h ; t
db 6Dh ; m
db 64h ; d
db 0
db 0
db 0
db 3Ch ; <
db 20h
db 0
db 0
db 0DCh ; Ü
db 0
db 0
db 0
db 2Eh ; .
db 72h ; r
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 7Ah ; z
db 7Ah ; z
db 7Ah ; z
db 64h ; d
db 62h ; b
db 67h ; g
db 0
db 0
db 0
db 18h
db 21h ; !
db 0
db 0
db 14h
db 0
db 0
db 0
db 2Eh ; .
db 69h ; i
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 32h ; 2
db 0
db 0
db 0
db 0
db 2Ch ; ,
db 21h ; !
db 0
db 0
db 14h
db 0
db 0
db 0
db 2Eh ; .
db 69h ; i
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 33h ; 3
db 0
db 0
db 0
db 0
db 40h ; @
db 21h ; !
db 0
db 0
db 8
db 0
db 0
db 0
db 2Eh ; .
db 69h ; i
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 34h ; 4
db 0
db 0
db 0
db 0
db 48h ; H
db 21h ; !
db 0
db 0
db 18h
db 0
db 0
db 0
db 2Eh ; .
db 69h ; i
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 24h ; $
db 36h ; 6
db 0
db 0
db 0
db 0
db 0
db 30h ; 0
db 0
db 0
db 0F7h ; ÷
db 1
db 0
db 0
db 2Eh ; .
db 64h ; d
db 61h ; a
db 74h ; t
db 61h ; a
db 0
db 0
db 0
__IMPORT_DESCRIPTOR_MSVCR100 dd rva off_402140 ; Import Name Table
dd 0 ; Time stamp
dd 0 ; Forwarder Chain
dd rva aMsvcr100Dll ; DLL Name
dd rva __imp_printf ; Import Address Table
align 20h
;
; Import names for MSVCR100.dll
;
off_402140 dd rva word_402148
dd 0
word_402148 dw 5D7h
db 'printf',0
align 2
aMsvcr100Dll db 'MSVCR100.dll',0
align 1000h
_rdata ends
; Section 3. (virtual address 00003000)
; Virtual size : 000001F7 ( 503.)
; Section size in file : 00000200 ( 512.)
; Offset to raw data for section: 00000800
; Flags C0000040: Data Readable Writable
; Alignment : default
; Segment type: Pure data
; Segment permissions: Read/Write
_data segment para public 'DATA' use32
assume cs:_data
;org 403000h
a27h0 db ',27h,0',0
; char Format[]
Format db '%s',0
aSp4ceAsmAlcopa db ';-; sp4ce.asm-;-; alCoPaUL [GIMO][A'
db 's][aBrA][NPA][b8]-; 10/6/2021-;-; n'
db 'asm <dash>f win32 sp4ce.asm-; link '
db 'sp4ce.obj /subsystem:console /defau'
db 'ltlib:msvcrt.lib /entry:m-;-global '
db 'm-extern _printf-section .text-m:mo'
db 'v al,10-mov bl,45-z:lea edx,a-mov c'
db 'x,491-r:cmp byte[edx],bl-je s-jmp u'
db '-s:mov byte[edx],al-u:inc edx-dec c'
db 'x-cmp cx,0-jnz r-push a-push i-call'
db ' _printf-mov al,10-cmp bl,45-xchg a'
db 'l,bl-je z-push x-push i-call _print'
db 'f-ret-section .data-x:db 2Ch,32h,37'
db 'h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db'
db ' ',27h,0
align 1000h
_data ends
end start
~~~~~~
so printf() is not broken down to pieces as you imply BUT is listed "by function" for EXTERNAL use,
as i saw, you converted the .asm object file to linux executable using GCC and compared it to the generated linux executable with different routines (with SYSCALL) to display texts using ld. you can link your print() assembled file using ld.exe WITH the appropriate C runtime library with your linux object file. try that and compare again,.
edit: the actual runtime for executing the code is MSVCR100.dll and you need to link the .obj file to the generic .dll file for the appropriate runtime file version (e.g. msvcrt.dll for Visual Studio 2010 C/C++).
edit1: grammar, etc.