A good book on assembly 
Author Message
 A good book on assembly

Hello there !
Can you tell me a good book on assembly language ?

Thanks,

Gustavo Muller



Tue, 08 Jan 2002 03:00:00 GMT  
 A good book on assembly
Here are two good books:

Assembly Language: Step by Step
(Jeff Duntemann)

The Revolutionary Guide to Assembly Language
(Maljugin, Izrailevich, Lavin, & Sopin)

- Justin Ronco



Tue, 08 Jan 2002 03:00:00 GMT  
 A good book on assembly
   Hello,

     I agree that Jeff Duntemann's book (Learning Assembly Language: Step By
Step) is excellent, and I like the fact that Mr Duntemann really keeps it
fun.  He does so in a non-condescending way, unlike so many authors.   Since
we are on the subject of his book, I am wondering if anyone can help me with
something I have been wrestling with in terms of his book:
     He said that ffff:0000 is the address of the first instruction in the
cold boot, yet when I use the 'G' command at that address (in DEBUG), it
merely returns me to my C: prompt as if a program ran and exited normally,
without screen output or errors.   I am using an IBM 760ELD laptop (although
I was told that it is a 486 when I bought it used, DEBUG thinks it is a 386
and I tend to believe the computer).   I followed the instructions numerous
times, and I completely understand the general ideas behind all of this, so
I am ABSOLUTELY positive that I am doing what the book says to do.   My CPU
is just not cooperating.  ;)
     Seriously, can anyone think of what I am doing wrong?   Thanks!

Seth Koster


antispam part)


Quote:
> Here are two good books:

> Assembly Language: Step by Step
> (Jeff Duntemann)

> The Revolutionary Guide to Assembly Language
> (Maljugin, Izrailevich, Lavin, & Sopin)

> - Justin Ronco



Wed, 16 Jan 2002 03:00:00 GMT  
 A good book on assembly


   >I always thought the reset routine was located in BIOS at 0E05B in
   >segment 0F:0000, effectively 0F:E05B, but I'm not an expert.
   >I don't like direct BIOS calls.  Why not reboot using INT 19?

Not a great way to reboot, IMHO.  On an AT-class machine (286 and
up), you're probably better off to ask the keyboard controller to
activate the CPU reset line:

        cli                     ;disable interrupts
        mov     al,0FEh         ;tell the keyboard controller to
        out     64h,al          ;  activate the CPU reset line
halt:
        hlt                     ;some motherboards require this
        jmp     halt            ;  ...again, just to be sure...

.....................................................................
Return address is mangled to foil spambots. Remove all "g"s to e-mail.

Net-Tamer V 1.08X - Test Drive



Thu, 17 Jan 2002 03:00:00 GMT  
 A good book on assembly

[snip]

: I don't like direct BIOS calls.  Why not reboot using INT 19?  If you want
: to select between a warm boot and a cold boot, stuff the value 1234h to
: location 0000:0472 for a warm boot and anything but that value for a cold
: boot, then execute INT 19.

zuh?  i thought int19 just loaded the bootstrap (without kicking TSRs
out of memory, that's why it's bad) and that the warm/cold boot flag had
no effect on it.  maybe some v86 managers hook int19 to make it less dumb,
but i've learned to avoid it.



Thu, 17 Jan 2002 03:00:00 GMT  
 A good book on assembly
   Hi,

     Thanks for all the responses, I really appreciate it.   I was mostly
just worried that I was misunderstanding something, but I see now what was
going on.
     Thanks again!

Seth K.


Quote:



> >[snip]

> >: I don't like direct BIOS calls.  Why not reboot using INT 19?  If you
want
> >: to select between a warm boot and a cold boot, stuff the value 1234h to
> >: location 0000:0472 for a warm boot and anything but that value for a
cold
> >: boot, then execute INT 19.

> >zuh?  i thought int19 just loaded the bootstrap (without kicking TSRs
> >out of memory, that's why it's bad) and that the warm/cold boot flag had
> >no effect on it.  maybe some v86 managers hook int19 to make it less
dumb,
> >but i've learned to avoid it.

> Again, I'm not an expert.  My primary reference, "IBM ROM BIOS" by Ray
> Duncan, Microsoft Press, 1988 says what I paraphrased above.  And it works
> on my old XT-clone and on my 486-clone so I've never questioned it.  Ralf
> Brown's list (which I was moved to read only after your response) mentions
> the problem of vectors 00h - 1Ch being preserved and mentions use of 1234h
> for a warm boot, but does so in conjunction with calling FFFF:0000, not
INT
> 19.

> So I guess I better be careful of using a 1988 reference and assuming
> "works for me" means it works for everyone - or at least refer to the Ralf
> Brown listing.  Thanks for the lesson!

> --
> Jim Higgins, higginsj AT ftc-i DOT net
> icbm: 33.55.34N, 80.24.21W
> http://web.ftc-i.net/~higginsj/index.html
> Please do not e-mail "courtesy copies" of USENET responses.



Fri, 18 Jan 2002 03:00:00 GMT  
 A good book on assembly


   > >        cli                     ;disable interrupts
   > >        mov     al,0FEh         ;tell the keyboard controller to
   > >        out     64h,al          ;  activate the CPU reset line
   > >halt:
   > >        hlt                     ;some motherboards require this
   > >        jmp     halt            ;  ...again, just to be sure...
   >
   >Just curious.  Why is this better than INT 19, other than the fact
   >that INT 19 could have been revectored?....

INT 19h isn't a "true" re-boot.  Yeah, it reads in the boot sector
and then jumps to the O.S. boot code, but it can leave everything
screwed up.  Memory isn't cleared, TSRs can still be resident, other
interrupts can remain revectored, the disk system isn't reset...plus,
it just plain =doesn't work= on some machines.  You might get a new
"DOS prompt," but the machine can lock at that point.  My turbo XT
barfs on the INT 19h call.

When you reboot, you generally want to start fresh, right from the
bottom up.  INT 19h, alone, doesn't do that.

If you want a quick and =complete= reboot from software -- and you're
running DOS -- just compile this code into a little 5-byte executable
(A86 compiler syntax):

        code    segment                 ;start of code segment
                org     100h            ;leave room for base page
        db      234,240,240,240,240     ;machine code for reboot
        end                             ;that's all, folks

.....................................................................
Return address is mangled to foil spambots. Remove all "g"s to e-mail.

Net-Tamer V 1.08X - Test Drive



Fri, 18 Jan 2002 03:00:00 GMT  
 A good book on assembly

Quote:

> >     He said that ffff:0000 is the address of the first instruction in the
> >cold boot, yet when I use the 'G' command at that address (in DEBUG), it
> >merely returns me to my C: prompt as if a program ran and exited normally,
> >without screen output or errors.

> [snip]

> >     Seriously, can anyone think of what I am doing wrong?   Thanks!

Intel's manuals (for P6 processors) say that the first instruction executed on
boot-up is at FFFF FFF0h.  CS points to FFFF 0000h and EIP to FFF0h.  The
processor starts in real-mode, with the segment selector in the CS register is
F000h, but this points to the said address, not to F FF00h (?) as it usually
would.  This is because the hidden part of the segment register is set to
initially point to FFFF 0000h.

As soon as a far jump is executed, the address that CS points to is formed in the
usual real-mode way.  Therefore, there is no way you can jump back to FFFF FFF0h
while still in real-mode.  Maybe it is possible by setting a segment register to
point to FFFF 0000h while in proteccted mode, and then switching back to
real-mode and using that segment register for a far jump?  I don't know.

The above is also (apparently) true for Pentium and 486 processors, but I don't
know about earlier ones.

Martin.

--
The higher,
The fewer.



Sat, 02 Feb 2002 03:00:00 GMT  
 A good book on assembly
   Hi,

     I'm the original poster from a while back, so thanks for the info.   I
had concluded that the problem was with the differences between the
8088/8086 processors which the book was originally written for, and my
processor (80486).   I appreciate the depth of the explanation you gave,
though.

SK



Sat, 02 Feb 2002 03:00:00 GMT  
 A good book on assembly

Quote:

>> >     He said that ffff:0000 is the address of the first instruction in
the
>> >cold boot, yet when I use the 'G' command at that address (in DEBUG), it
>> >merely returns me to my C: prompt as if a program ran and exited
normally,
>> >without screen output or errors.

>> [snip]

>> >     Seriously, can anyone think of what I am doing wrong?   Thanks!

>Intel's manuals (for P6 processors) say that the first instruction executed
on
>boot-up is at FFFF FFF0h.  CS points to FFFF 0000h and EIP to FFF0h.  The
>processor starts in real-mode, with the segment selector in the CS register
is
>F000h, but this points to the said address, not to F FF00h (?) as it
usually
>would.  This is because the hidden part of the segment register is set to
>initially point to FFFF 0000h.

>As soon as a far jump is executed, the address that CS points to is formed
in the
>usual real-mode way.  Therefore, there is no way you can jump back to FFFF
FFF0h
>while still in real-mode.  Maybe it is possible by setting a segment
register to
>point to FFFF 0000h while in proteccted mode, and then switching back to
>real-mode and using that segment register for a far jump?  I don't know.

>The above is also (apparently) true for Pentium and 486 processors, but I
don't
>know about earlier ones.

>Martin.

Actually this information is incorrect, on boot up the CS/IP are forced to
FFFF:0000
not FFFF:FFF0. FFFF:0000 is the code for the cold boot sequence. FFFF:FFF0
if I remember correctly is the sequence for the three finger salute (warm
boot).

Theres also somewhere in there that something in segment 40h has to be set
somewhere but I cant remember exactly where which allows a softboot without
clearing
memory ??

According to HelpPC:
------------------------------
(Copyright 1992 David Jurgens, available at
ftp://x2ftp.oulu.fi/pub/msdos/programming/docs/helppc21.zip
Its VERY USEFUL get this ;})

        POST - Cold Boot / Power On Self Test Activities

        - power supply starts Clock Generator (8284) with Power
          Good signal on BUS
        - CPU reset line is pulsed resetting CPU
        - DS, ES, and SS are cleared to zero

        Cold and Warm Boot both execute the following sequence
        - CS:IP are set to FFFF:0000 (address of ROM POST code)
        - jump to CS:IP  (execute POST, Power On Self test)
        - interrupts are disabled
        - CPU flags are set, read/write/read test of CPU registers
        - checksum test of ROM BIOS
        - Initialize DMA (verify/init 8237 timer, begin DMA RAM refresh)
        - save reset flag then read/write test the first 32K of memory
        - Initialize the Programmable Interrupt Controller (8259)
          and set 8 major BIOS interrupt vectors (interrupts 10h-17h)
        - determine and set configuration information
        - initialize/test CRT controller & test video memory (unless 1234h
          found in reset word)
        - test 8259 Programmable Interrupt Controller
        - test Programmable Interrupt Timer (8253)
        - reset/enable keyboard, verify scan code (AAh), clear keyboard,
          check for stuck keys, setup interrupt vector lookup table
        - hardware interrupt vectors are set
        - test for expansion box, test additional RAM
        - read/write memory above 32K (unless 1234h found in reset word)
        - addresses C800:0 through F400:0 are scanned in 2Kb blocks in
          search of valid ROM.  If found, a far call to byte 3 of the ROM
          search of valid ROM.  If found, a far call to byte 3 of the ROM
          is executed.
        - test ROM cassette BASIC (checksum test)
        - test for installed diskette drives & FDC recalibration & seek
        - test printer and RS-232 ports.  store printer port addresses
          at 400h and RS-232 port addresses at 408h.  store printer
          time-out values at 478h and Serial time-out values at 47Ch.
        - NMI interrupts are enabled
        - perform INT 19 (bootstrap loader), pass control to boot record
          or cassette BASIC if no bootable disk found
        - WARM BOOT procedure is now executed

To test this out on your own machine however: Try the following
debug scripts.

----- >8 HARDBOOT.COM 8<-----
n hardboot.com
a 100
JMP FFFF:0000

rcx 5
w
q

----- >8 SOFTBOOT.COM 8<-----
n softboot.com
a 100
JMP FFFF:FFF0

rcx 5
w
q

The first one should preform your memory test, the second one should not.
Note that HelpPC says that they both jump to FFFF:0000 They just may
but I remember FFFF:FFF0 working for a soft boot.

Therefore in pmode if you set a selector to point to 0xFFFF0 and far jump to
it, you
would figure that it should "cold boot" your machine by normal thinking, but
I dont
believe pmode will allow it. If I remember correctly, Instead it will either
throw a
general exception, or will fault.

If you wish to reboot your machine after loading in PMODE most likely the
best
way is to shut off all interrupts (Non maskable and maskable) return to real
mode
by modifying the protection bit of CR0, and then FAR JMP FFFF:0000

This shouldn't be a problem because youre rebooting the machine anyways so
you arent exactly worried about dropping back to real mode to run a few
opcodes
;}

If your assembler will not allow far jump immediate then you can do this

... code here...
... code here...
db 0EAh, 00h, 00h, 0FFh, 0FFh            ; Cold boot the computer.
... code here...
... code here...

Hope Ive been of some help instead of just confusing you ;}

-- The Dragon



Sun, 03 Feb 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Good books on assembly for OS development

2. Good Books 4 Assembly.

3. Arrays and Loops (also need a good book on assembly)

4. Good book on assembly?

5. Can somebody recommend a good book on assembly?

6. Good book on assembly?

7. Search a good book for 370 Assembly

8. Anyone know of a good book to learn Assembly Language Programming (x86/Pentium Processors)

9. Best Book to learn assembly language ?

10. Suggestions for a newbie on good assembly book

11. need a good assembly book for college?

12. Good Assembly programming books

 

 
Powered by phpBB® Forum Software