flat assembler
Message board for the users of flat assembler.
Index
> DOS > How to do a concatenation ? |
Author |
|
nop 08 Jun 2010, 07:06
maybe something like:
Code: set_string_level: ;enter with binary level in ax (max 9999 decimal) push ds push cs pop ds cmp ax, 9999 ja error call bin2bcd ;returns 4 bcd digits in eax call bcd2ascii ;returns 4 ascii chars in eax mov [string_number],eax pop ds ret string: db "data/lvl/lvl_" string_number: dd 0 string_end: db ".bw" string_delimiter: ;if needed db 0 now you just need to code bin2bcd and bcd2ascii or maybe there's a better way? |
|||
08 Jun 2010, 07:06 |
|
baldr 08 Jun 2010, 07:15
vanzan,
Code: org 0x100 mov ax, [Level] mov di, name.level call convert0000 mov dx, name ; output to test it mov ah, 9 int 0x21 ret convert0000: mov cl, 100 div cl mov cl, ah call convert00 mov al, cl convert00: aam or ax, '00' xchg al, ah stosw ret Level dw 9876 name db "data/lvl/lvl_" .level db "0000.bw", 13, 10, '$'; for int21/09 |
|||
08 Jun 2010, 07:15 |
|
vanzan 08 Jun 2010, 07:32
The code seems to be correct but it doesn't work...
(3) wrong parameters: MOV bx, name.llevel (3) probably no zero prefix for hex; or no 'h' suffix; or wrong addressing; or undefined var: name.llevel I don't understand the syntax "name.llevel"... |
|||
08 Jun 2010, 07:32 |
|
baldr 08 Jun 2010, 07:38
vanzan,
This is FASM board. Are you compiling with FASM? |
|||
08 Jun 2010, 07:38 |
|
vanzan 08 Jun 2010, 07:48
With emu8086, we had to use it for our project.
But it's a FASM compiler, isn't it ? (FASM v1.64) |
|||
08 Jun 2010, 07:48 |
|
baldr 08 Jun 2010, 08:21
vanzan wrote: With emu8086, we had to use it for our project. |
|||
08 Jun 2010, 08:21 |
|
edfed 08 Jun 2010, 10:19
just say to your teacher that emu8086 is pure shit and that nowadays, fasm(w)(d) is the better choice to learn PC assembly.
|
|||
08 Jun 2010, 10:19 |
|
vanzan 08 Jun 2010, 10:35
I totally agree with you but I don't have any choice...
|
|||
08 Jun 2010, 10:35 |
|
edfed 08 Jun 2010, 11:08
you always have the choice.
it is up to you to show the ease of use of new asm compilers to your teacher... i suppose he(she) impose emu8086 to you because he(she) don't know anything else... |
|||
08 Jun 2010, 11:08 |
|
vanzan 08 Jun 2010, 11:23
No, we HAVE to use emu8086... Even if it's a very old architecture, we used it in order to learn assembly.
I've already asked him if I could change the compilers but NO, we have to use it.... PS: in french : Mon école est assez rigide sur le sujet, bon nombre d'autres groupes (qui avaient commencé sur d'autres langages comme RadASM, MASM,...) ont du recommencer leur projet sous peine d'avoir 1 zero. |
|||
08 Jun 2010, 11:23 |
|
edfed 08 Jun 2010, 14:44
je prefere avoir un zero pointé que d'utiliser un truc inutile. emu 8086 est un truc inutile, totallement inutile, bon pour les profs sclerosés qui vraiment ne connaissent rien d'autre que leurs bonnes vieilles methodes obsoletes.
je serait à ta place, je prendrai un zero(en codant le truc avec QBASIC), et en plus, j'essayerai d'effacer toute trace d'emu8086 des pc du college (ou lycée). |
|||
08 Jun 2010, 14:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.