I'm not sure yet what order function parameters are stored in on the stack 
(this is one of the things I still need to figure out) but this particular 
Small C also sets accumulator A to be equal to the number of parameters. 

And then (from what I'm seeing in the generated code) doesn't use this value. 
:-)

Anyway, for a further teaser, here's your code back, with the generated 
assembly and a binary.

A few notes: I'm not sure if putc('\n') works or not, a lot of shotgun 
debugging took place here.  Main() has to be the first function in the file 
because I don't have cstart yet. 

And if anybody has some docs on the language of Small C itself, that would be 
really really useful!


Willard

Sent from Samsung tablet

Attachment: hex.c
Description:

Attachment: hex.co
Description:

Attachment: hex.s
Description:

Reply via email to