[Info-vax] How to write "Hello, world" in x86 assembly (llvm-mc)?

Jake Hamby (Solid State Jake) jake.hamby at gmail.com
Tue Nov 7 18:18:39 EST 2023


On Tuesday, November 7, 2023 at 11:34:01 AM UTC-8, Jake Hamby wrote:
> 
> I suspect the fix is as simple as a slightly different declaration for my code segment or the ELF$TFRADR global symbol. The nice thing about using Pascal instead of C for comparison is the Pascal version isn't pulling in any runtime support libraries, and its ELF$TFRADR is pointing at the start of the procedure code. So the linker mapping looks like the only relevant difference. I also wrote a MACRO-32 version and that looked essentially the same as the Pascal version, except with more pushing and popping of (unused) temp registers to the stack.

I posted to the VSI Forum about my problem and got back a solution almost immediately. The magic line I needed to add:

.type ELF$TFRADR, @function

Simon's right about the code I posted declaring the 64-bit descriptor incorrectly. The "must be -1" field must be a .long and not a .word. After fixing that issue and adding the line above, it all works now.



More information about the Info-vax mailing list