nasm -> gas
The truth is that up to this point, I have not pushed a WORD value onto the stack in my kernel. I have not developed a big kernel yet but I try to use 32-bit registers/values as much as possible because of the whole partial register stall you can get on modern CPUs. By the way, sorry about my interpretation of your opcodes I must have been really sleep not to have seen the rest of the lines.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
You should always push 32-bits if you're in 32-bit mode, to keep your stack aligned properly. Properly aligned data in general is a "Good Thing(tm)". Even if you wanted to push 16-bit value in stack, you'd better off extending it to 32-bits before, to avoid misaligning the stack.
In 16-bits mode that's ofcourse not a problem, but I guess it mostly makes sense to push 16-bit values there... YMMV.
In 16-bits mode that's ofcourse not a problem, but I guess it mostly makes sense to push 16-bit values there... YMMV.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
Bochs log IS terribly helpful when it gives weird errors, because chances are there aren't many place in Bochs where it can be from, and I've managed to trace several bugs by looking at Bochs sources to see why it would give such a strange error message..
Bochs source is a bit tedious at first, but grep is your friend.
Bochs source is a bit tedious at first, but grep is your friend.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
-
- Member
- Posts: 97
- Joined: Thu Mar 15, 2007 2:27 pm
Re: nasm -> gas
In NASM, you would useehird wrote:^ bonafide kernel dev tutorialCode: Select all
push byte 0 push byte 1 etc
GAS only accepts "push something". What does nasm do here, and how would I do it in gas?
thanks
Code: Select all
push byte
Code: Select all
pushb
Code: Select all
pushl