Closed xuchunyang closed 9 years ago
Here is the ruby code to create abundant and repeating NASM code from src/kern/entry.S:
src/kern/entry.S
NINT = 128 0.upto(NINT) do |i| puts %{ _hwint#{i}: #{'push dword 0' if i!=17 and (i<8 or i>14)} push dword #{i} jmp _hwint_common_stub } end # generate the vector table puts %{ ; vector table [section .data] [global _hwint] _hwint: } 0.upto(NINT) do |i| puts " dd _hwint#{i}" end
Is it difficult to implement this with nasm macro?
hmmm, the ruby script is the poor man's macro, maybe it's reasonable to refactor with nasm macro, but i'm not familiar with it, any pull request is welcomed :)
Here is the ruby code to create abundant and repeating NASM code from
src/kern/entry.S
:Is it difficult to implement this with nasm macro?