[ aster @ 12.12.2002. 00:44 ] @
Poceo sam da ucim programiranje u Asembleru iz knjige "The art of assembly programming language" za koju sam cuo da koriste ili su koristili mnogi clanovi na ovom forumu (od nekih od njih sam i dobio preporuku da pocnem da ucim asembler ovom knjigom). U toj knjizi pise da ce se u tim primerima iz knjige koristi UCR biblioteka pa sam je skinuo sa neta kao i izvorni kod programa koji se koristi u knjizi, znaci nisam ja pisao te programe vec su to navodno vec provereni programima koji bi se nalazili na companion CDu. Biblioteku nisam snimio na C:\stdlib kao sto tamo pise jer imam podeljeni hard disk vec sam je snimio na drugoj particiji gde mi je MASM32 7 instaliran i to u istom direktorijumu gde je i MASM32. Na pocetku da ne bude zabune, takodje sam (koristim Windows XP, na Athlonu) u Windowsu u user variablama dodao sam u include path: F:\MASM32\INCLUDE;F:\MASM32\STDBLIB\INCLUDE (stdlib je mesto gde je smestena UCR biblioteka) za lib path takodje: F:\MASM32\LIB;F:\MASM32\STDLIB\LIB a u pathu i za user i za system varijable sam ubacio: F:\MASM32\BIN Medju izvornim fajlovim za cetvrto poglavlje nalazi se i fajl shell.asm koji se u knjizi opisuje kao skelet program. U knjizi se o njemu jos kaze da ne radi nista ali da se sa MASMom prevodi bez problema i sluzi samo kao primer skeleta obicnog programa u asembleru. Fajl je sledece sadrzine i koriste UCR: Code: .xlist include stdlib.a includelib stdlib.lib .list dseg segment para public ‘data’ ; Global variables go here: dseg ends cseg segment para public ‘code’ assume cs:cseg, ds:dseg ; Variables that wind up being used by the standard library routines. ; The MemInit routine uses “PSP” and “zzzzzzseg” labels. They must be ; present if you intend to use getenv, MemInit, malloc, and free. public PSP PSP dw ? ;-------------------------------------------- ; Here is a good place to put other routines: ;----------------------------------------------------------------- ; Main is the main program. Program execution always begins here. Main proc mov cs:PSP, es ;Save pgm seg prefix mov ax, seg dseg ;Set up the segment registers mov ds, ax mov es, ax mov dx, 0 meminit jnc GoodMemInit db “Error initializing memory manager”,cr,lf,0 jmp Quit GoodMemInit: ;*************************************************************************** ; Put your main program here. ;*************************************************************************** Quit: ExitPgm Main endp cseg ends ; Allocate a reasonable amount of space for the stack (2k). sseg segment para stack ‘stack’ stk db 256 dup (“stack “) sseg ends ; zzzzzzseg must be the last segment that gets loaded into memory! zzzzzzseg segment para public ‘zzzzzz’ LastBytes db 16 dup (?) zzzzzzseg ends end Main Ovaj program nikako ne mogu da prevedem! Pokusavao sam i sa MASMom verzije 6 i 7. U MASM editoru koji dolazi zajedno sa njim (QEDITOR) prijavljuje sledece greske: Code: Assembling: F:\test\SHELL.asm F:\masm32\stdlib\INCLUDE\stdlib.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\stdout.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\stdin.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\memory.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\conv.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\strings.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\charsets.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\fp.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\misc.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\lists.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\ser.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\pattern.a(26) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\date.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\time.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\process.a(1) : error A2214: GROUP directive not allowed with /coff option F:\masm32\stdlib\INCLUDE\file.a(1) : error A2214: GROUP directive not allowed with /coff option F:\test\SHELL.asm(6) : error A2044: invalid character in file F:\test\SHELL.asm(10) : fatal error A1010: unmatched block nesting : dseg Znaci prijavljuje greske u fajlovima UCR biblioteke koji su takoreci provereni za rad sa MASMom. Dok kada pozovem ml iz komandne linije prijavljuje samo ove greske (zadnje dve): Code: Assembling: SHELL_comments.asm SHELL_comments.asm(6) : error A2044: invalid character in file SHELL_comments.asm(10) : fatal error A1010: unmatched block nesting : dseg Da li je greska ipak u programu ili sam nesto zaboravio ili lose konfigurisao ili mozda ima veze sto se prevodi na Athlonu? Svaki savet u vezi sa ovim problemom je dobrodosao. Nadam se da je jos neko koristio UCR biblioteku sa MASMom pri ucenju iz knjige "The art of assembly programming language". Unapred hvala. |