I think when games made with AXE (like this one:
http://tiforge.info/zcontest3/?a=projet&id=71) take 20kB of RAM, and everybody tends to use the TI84+ with plenty of user space, then saving 3 bytes isn't much of a deal. And when it saves 300 bytes, and when it saves 30000 bytes, it's doesn't really matter. Jim e was actually one of those who even unrolled loops to save a few cycles. But I must admit that writing good AND short code is a challenge that is, with today's resources, often sidestepped.
I could have problems "reassembling" this code into pure asm:
- Code: Select all
Fight.Draw.health
; displays health for current player
call Player.getHealth
pen 22, 41
disp2
putS 23, 49, 5, heart
ret
ok, let's start:
- Code: Select all
Fight.Draw.health
; displays health for current player
call Player.getHealth
;pen 22, 41
; okay, don't overwrite A
; how do you put two values into one register again?
ld de, 22 * 256 + 41
; was it penCol or penRow?
ld (penCol), de
;disp2
; okay just replace this
call disp_2
;putS 23, 49, 5, heart
; hmm look at the sprite routine source code to find input documentation
ld l, 23
ld a, 49
ld b, 5
ld ix, heart
call smallSprite
ret
It took a while to look everything up and it didn't even save a BIT (okay, contrived example

)
Macros are
encapsulated,
tested,
documented. You can't forget parameters. They are
extensible and
easy to use.
chickendude wrote:If i don't understand how something works, it's always because i'm too lazy to sit down and actually look at it.
"If it's hard to code it should be hard to read." is C-mentality that I rather discourage from. Of course, demanding the opposite (the object oriented approach) would be too much for assembler, sure. If you manage to write good code, you are good. No problems

.
As a programmer it becomes hard to put oneself in a noob's position. But I think a hello world program like mine is less daunting. Everything, even registers, can be explained
later. You understand it by looking at it.