Assembly code
4 posters
CMPC :: Computing :: Programming :: General Coding
Page 1 of 1
Assembly code
If you're thinking about using assembly to write programs, don't. If you don't believe me, here's a "Hello World" program.
And a slightly nicer-looking one:
See what I mean?
- Code:
.intel_syntax noprefix
#obscured
.section .text
.balign 16
_fb_ctor__hi:
.Lt_0001:
push 1
push 12
push offset _Lt_0003
call _fb_StrAllocTempDescZEx@8
push eax
push 0
call _fb_PrintString@12
push -1
call _fb_Sleep@4
.Lt_0002:
ret
#obscured
.section .data
.balign 4
_Lt_0003: .ascii "hello world!\0"
.section .ctors
.int _fb_ctor__hi
.section .fbctinf
.byte 16
.byte 1
.byte 6
.ascii "user32\0"
.byte 0
.byte 0
And a slightly nicer-looking one:
- Code:
.intel_syntax noprefix
#obscured
.section .text
.balign 16
_fb_ctor__hi:
.Lt_0001:
push 0
push 0
push 0
push 8
push 18
call _fb_GfxScreen@20
push 1
push 12
push offset _Lt_0003
call _fb_StrAllocTempDescZEx@8
push eax
push 0
call _fb_PrintString@12
push -1
call _fb_Sleep@4
.Lt_0002:
ret
#obscured
.section .data
.balign 4
_Lt_0003: .ascii "hello world!\0"
.section .ctors
.int _fb_ctor__hi
.section .fbctinf
.byte 16
.byte 1
.byte 5
.ascii "fbgfx\0"
.byte 6
.ascii "user32\0"
.byte 5
.ascii "gdi32\0"
.byte 5
.ascii "winmm\0"
.byte 0
.byte 0
See what I mean?
Corey- Mod
- Posts : 462
Re: Assembly code
lol i used assembly code to run my small personal robot (i built it over the summer). I used BASIC to program the basic stamp 2. it was fun but even though my code was good, my robot sucked because i lacked metal/building parts / good wheels / sensors / etc etc... LONG LIST.
I'm gonna try and do it again soon. Possibly for a senior project? Idk anything nice would do for the senior project.
I'm gonna try and do it again soon. Possibly for a senior project? Idk anything nice would do for the senior project.
Admin- Pirate King
- Posts : 559
Re: Assembly code
Actually according to Angie, while assemble sucks it teaches you a bunch about programming, especially for embedded systems.
Unchained- Mod
- Posts : 448
Similar topics
» NEED HELP WITH CODE :O
» How to Debug your Code
» Sample Code
» Some Potentially Useful Code
» Code snippets
» How to Debug your Code
» Sample Code
» Some Potentially Useful Code
» Code snippets
CMPC :: Computing :: Programming :: General Coding
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|