--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBP00001Date: 07/12/97 From: JAN WAGEMAKERS Time: 08:31am \/To: HERMAN SCHONFELD (Read 1 times) Subj: Memory! Hello Herman, Herman Schonfeld wrote to Craig Hart : HS> CH> Correction to lesson one: in real mode, the 286+ can HS> CH> access 1088kb-16 bytes of memory. This is achieved by HS> CH> segmentreg=FFFFh offset reg=0 to FFFFh. This is how the 286+ ITSELF HS> CH> operates. HS> It can't access 1088kb. A 16-bit pointer can only access up to HS> 2^16 bytes, or 64kb. HS> "When in real mode, the 80x86 processor is has limited access to HS> only 1,024 kb using a segment:offset resolution." "Extending DOS, Ray HS> Gwin". From : "The Undocumented PC" : 1MB Segment Wrap The 286 and all later CPUs provide 16MB or more of memory address range as compared with the 8088's 1MB maximum memory address range. A quirk with the 8088 addressing scheme allowed a program to access the lowest 64KB area using any segment:offset pair that exceeded the 1MB limit. For example, the segment offset FFFF:50 will access the same byte as 0:40. Altough there is no reason for software to ever use this quirk, bugs in a few very old programs used segment:offset pairs that wrap the 1MB boundary. Since these programs seemed to work correctly, no actions were taken to correct the defects. The 286 provide 16M of addressability, and provides its own quirk when accessing memory with a segment:offset pair that would cause a wrap on the 8088. _!_Instead, the 286 CPU accesses 64KB just above the 1MB boundary._!_ Table : illustrate the differences in adressing memory between the 8088 and the 80286. | Segment:Offset | 8088 Physical | 80286 Physical | | Address | Address | Address | Notes |----------------+---------------+----------------+--------------------------- | FFFF:0 | 0FFFF0h | 0FFFF0h | Same physical address |----------------+---------------+----------------+--------------------------- | FFFF:10 | 0 | 100000h | 1M difference |----------------+---------------+----------------+--------------------------- | FFFF:FFFF | 0FFEFh | 10FFEFh | 1M difference, limit is | | | | 16 bytes from end of 64KB | | | | block +----------------+---------------+----------------+--------------------------- (Note from me : In the above tabel you can see that the 80286 can access 1024KBytes + 64Kbytes - 16Bytes = 1088KBytes - 16Bytes ) HS> CH>Finally, you can switch on the A20 gate yourelf if you like and HS> restore CH>the CH>full addresability - you just need to know how to HS> program the hardware, CH>or, in this day and age, ask Himem.sys to do HS> it for you. HS> Well, perhaps you could give me your "reference" so I could go HS> over it, it seems doubtful that they would include that feature. Also from : "The Undocumented PC" : A20 Gate To make the 80286 system appear identical to the 8088 addressing, IBM added external hardware to the 80286 to force the A20 address line to zero. This hardware is referred to as the A20 gate. When the A20 gate is in its default state, access to memory at 1MB will actually access memory in the first 64K, just like the 8088. To allow memory access above the 1M boundary, the A20 gate is enabled. The state of the CPU's address line 20 is then passed unaltered. This allows access to _!_64K (less 16 bytes) just above the 1M boundary in all CPU modes, real and protected._!_ To access the remainder of extended memory, it is necessary to go into protected mode, or use tricks. (undocumented LOADALL instruction.) The 64K area just above the 1MB area is reffered to as the High Memory Area (HMA). Recent versions of DOS can load portions of itself into the HMA to save place in the lower 640K. To make the HMA work, the A20 line must be enabled. Have a nice day, Herman. - Jan Wagemakers - .!. Life is short and love is always over in the morning (The Sisters of Mercy) --- Terminate 4.00/Pro * Origin: - Belgi/Belgium - Internet : JanW@mail.dma.be (2:292/8133.23) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBP00002Date: 07/12/97 From: JAN WAGEMAKERS Time: 05:10pm \/To: ALL (Read 1 times) Subj: sat.s (Linux-Asm) Hi All, I post here sat.s , a little linux-asm-program. It is not very spectacular, but nice for watching to. ;-) Comments, improvements, suggestions are more then welcome. ( Maybe adding a littlebit of color ;-) At this moment, I like to find a way to keep the speed of the program the same for all types of computers, independently of how much system resources are taken away by other programs. Someone an idea? ___ sat.s _________________________________________________________________ .include "/home/jan/assembler/include/ncurses.asm" .globl main main: _initscr _locate $1,$0 _printw $titel _locate $46,$0 _printw $pd _locate $32,$12 _printw $world movl $0,%esi lus: movb tabel(%esi),%dl # %dl = X(%esi) incl %esi movb tabel(%esi),%cl # %cl = Y(%esi) incl %esi cmpb $242,%cl jne n242_1 movl $0,%esi jmp lus n242_1: movl %esi,%edi redo: movb tabel(%edi),%dh # %dh = X(%esi + 1) incl %edi movb tabel(%edi),%ch # %ch = Y(%esi + 1) cmpb $242,%ch jne n242_2 movl $0,%edi jmp redo n242_2: movl $leeg,%ebp call print_item movl $linux,%ebp movb %ch,%cl movb %dh,%dl call print_item movl $2000000,%ecx w8: loop w8 _refresh jmp lus _endwin ret print_item: pushal movzbl %cl,%eax movzbl %dl,%ebx _locate %ebx,%eax _printw %ebp popal ret linux: .string "Linux" leeg: .string " " world: .string "World Domination" titel: .string "sat.s - 1997 Jan Wagemakers -" pd: .string "Donated to the Public Domain :-)" tabel: .include "cirkel.dat" .byte 242,242 .END ___________________________________________________________________________ ___ cirkel.dat ____________________________________________________________ .byte 72 , 12 .byte 71 , 13 .byte 69 , 15 .byte 66 , 17 .byte 62 , 18 .byte 56 , 20 .byte 51 , 21 .byte 44 , 21 .byte 38 , 21 .byte 31 , 21 .byte 24 , 21 .byte 18 , 20 .byte 13 , 19 .byte 8 , 17 .byte 5 , 16 .byte 3 , 14 .byte 2 , 12 .byte 2 , 10 .byte 3 , 8 .byte 6 , 7 .byte 10 , 5 .byte 15 , 4 .byte 20 , 3 .byte 27 , 2 .byte 33 , 2 .byte 40 , 2 .byte 47 , 2 .byte 53 , 3 .byte 59 , 4 .byte 63 , 5 .byte 67 , 7 .byte 70 , 8 .byte 71 , 10 ___________________________________________________________________________ ___ /home/jan/assembler/include/ncurses.asm _______________________________ # ncurses.asm - donated to the public domain by Jan Wagemakers - # afgeleid van onderstaand C-programma # #include # # int main(void) # { # initscr(); /* Init the curses libraries */ # move(10, 2); /* Place the cursor at X: 2, Y: 10 */ # printw("Hello, World !"); /* Print anything */ # refresh(); /* This places the "Hello, World !" on the physical screen */ # getch(); /* Wait for keypress */ # endwin(); /* deinit the curses libraries. */ # return 0; # } # # Vermits ikzelf bitter weinig van C ken kan volgende uitleg niet helemaal # korrekt zijn. Korrekties zijn dus meer dan welkom :-) # Dus, om via ncurses op een welbepaalde plaats op het scherm iets af te # drukken roep je onderstaande macro's aan : # 1. _initscr # 2. _locate x y (x,y = scherm-koordinaten) # 3. _printw message # 4. _refresh # 5. _endwin (end win.... klinkt leuk he ;-) .MACRO _initscr # start _initscr call initscr # end _initscr .ENDM .MACRO _locate x y # start _locate x y pushl \x pushl \y movl stdscr,%eax pushl %eax call wmove addl $12,%esp # end _locate x y .ENDM .MACRO _printw message # start _print message pushl \message call printw addl $4,%esp # end _printw message .ENDM .MACRO _refresh # start _refresh movl stdscr,%eax pushl %eax call wrefresh addl $4,%esp # end _refresh .ENDM .MACRO _endwin # start _endwin call endwin # end _endwin .ENDM ___________________________________________________________________________ as sat.s -o sat.o gcc sat.o -o sat -lncurses sat Have a nice day, All. - Jan Wagemakers - .!. Front 242 : Welcome to paradise. --- Terminate 4.00/Pro * Origin: - Belgi/Belgium - Internet : JanW@mail.dma.be (2:292/8133.23) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBP00003Date: 07/18/97 From: MICHAEL MUELLER Time: 12:00am \/To: JON GENTIL (Read 1 times) Subj: Re: Bug??? Hi Jon, you wrote in /FIDO/80XXX at 16 Jul 97: JG> CLI JG> Mov AX, 0003 JG> Int 010 JG> JG> I thought CLI was supposed to disable ALL interrupts. Hmmm.... CLI does disable the hardware-interrupts but when you call an interrupt with the int-operation this is an software-interrupt that does just a far- call with storing the flags on the stack before. Michael --- CrossPoint v3.11 * Origin: VIRNET 9:493/3160.3 (2:2452/249.3) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBP00004Date: 07/18/97 From: HANS LUNSING Time: 10:39am \/To: N.FERRI@AGORA.STM.IT (Read 1 times) Subj: Re: Change video mode Hello Nicola Ferri On Monday, 14 July 1997 08:30:40, you wrote to All: N> From: Nicola Ferri Subject: Re: Change video mode N> &>& mov ah,0003h mov al,1000b int 10h N> This is the same solution I found on a book but doesn't work N> very well, in fact after setting the bit in AL (I use OR N> AL,1000000B) the screen is locked up. That's to say that CLS, for N> example, doesn't work. The last image to be displayed on screen just N> before changing the video mode stays there and there is no way to N> kick it away. N> I'd need a solution to get back to 03h int10h viedo mode without N> clearing the screen, but keeping the PC still usable :) You placed the mode number in AH, but is has to be in AL. AH is for the funtion number, and that's 0 for setting the video mode. So for setting video mode 3 without clearing its screen you have to give the following instructions: mov ax, 83h int 10h Friendly greeting you, Hans Lunsing, Fido : 2:281/607.214 Internet : jlunsing@doge.nl --- Terminate 4.00/Pro * Origin: The Animal Farm For BASIC Programmers! ++31793512523 (2:281/607.214) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EBP00005Date: 07/19/97 From: AUKE REITSMA Time: 10:56am \/To: JAMES VAHN (Read 1 times) Subj: to ALL? Hi James, On 17 Jul 97, 21:54, you wrote to Jon Gentil >> Your message? It looks just fine to me. Here's a copy of it: >> >> ... The Moon is Waxing Gibbous (72% of Full) >> -+- FMail/386 1.22a+ >> + Origin: 300 miles East of Seattle, WA JV> Interesting. No Fido address in the Origin line and a mention of JV> FMail/386 1.22a+, which I'm not running. Strange. JV> -+- ifmail-tx (i386 Linux) JV> + Origin: James Vahn (jvahn@short.circuit.com) (1:346/15.1) This is how it looks to me. And your original message also had the ifmail line and the point number. BTW, my excuses for that "may I flame this person" line in another thread. I told you privately I would stay out of this mess. And I didn't. I'm really sorry I could not resist it! Greetings from _____ /_|__| Auke Reitsma, Delft, The Netherlands. / | \ -------------------------------------- --- GEcho 1.00 * Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20)