Hey, I can totally understand that this did not work out for you. I am glad nonetheless that you gave it a try anyways, and mentioned the issues you faced, so we can improve on them. Thanks for that!
This was originally made primarily for our own use, so I can definitely understand that the choices we made for this is not everyone's cup of tea.
However, I would just like to reply to the points, in case anyone else is also facing the same things.
- DB indeed doesn't support setting multiple different values, and that is definitely a thing we should change when we update his. Alternatively you can set multiple bytes to a same value using `DB [value,count]`
- Yes, this is intentional. As this emulator is not a "true" 8086 emulator that can just start from any memory address, we need a start label, much similar to how C needs a main function.
- Again, intentional. DB is strictly for data storage, and the whole code is (internally) split into data section (at start) and code section (after data section). Thus you cannot define DB once you start the code section. And as said, start indicates entry point of code, so any DB instruction cannot have start label.
- NOP is not implemented, and is an open issue at the repo.
- DB can be used without a label. for example
```
db [7,5]
DW 0x7857
start:
mov byte[0], 5
```
is a valid and compiling code. In case you had any issues using DB without label, feel free to comment here, or open an issue on github.
- Yes, ret cannot be used outside procedures. This is again intentional. As this emulator was aimed at students and newcomers to assembly, we wanted to kind of safeguard from accidentally using ret outside of a procedure context. In real assembly, it will let you use ret anywhere, but this does not.
> Also the terms. "compiling" is the process that generates assembly from a higher language. "assembling" is the process of turning assembly into machine code.
You are very much correct on this one. However, in this particular case I would suggest use of 'compiling' is also correct. As noted, this is an emulator of 8086, and we use an string based IR generated from the input assembly code. (This is not the best choice in hind-sight and there is an open issue for changing this). In that sense, we are indeed "compiling" the assembly code you have given to an executable/runnable representation, which then the emulator (which is basically an interpreter in this case) can run.
That said, I do agree that in general, (not in particular context of this emulator) "compiling" is not suited.
---
All said, This might not be everyone's choice for emulator, and I am glad that you gave it a try. Thanks!