News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Need some tough questions on 8086

Started by purifier, April 20, 2006, 02:55:25 PM

Previous topic - Next topic

purifier

I have a Interview tomorrow... Can someone please provide me some tricky questions concerning with 8086 with solutions so that I can have a look before I go? Please Help...

P1

Who would want to know?

I have not seen a 8086 in any kind of current electronics.  And just maybe, It's still maintain in a dedicated controller board somewhere in a RTC OS.

If you know the basics of 16bit software and understand the interupts and a few support chips, i.e 8259 PIC, 8255 Parallel, DMA, Serial and Keyboard controllers, you should do OK.  And Oh Yeah, the fun graphics too.  You would be so lucky, to only deal with a serial terminal port interface.

Regards,  P1  :8)

purifier

Yeah I know... Nobody uses that now, but its kind of a platform for complete beginners. So, I was just wondering... ::)

Mark Jones

Questions, sure. Answers: No. Giving solutions is not "help" it is cheating. Here are 10 basic questions for you to work on if you want to learn this stuff. If you can answer them yourself then you might have a chance at the job. If not, then...

1. MOV 16 into AX then SHL AX,1. What does AX equal?
2. CX=57h. ADD CL,99h. What does CX equal?
3. CX=57h. ADC CX,99h. What does CX equal?
4. DX=20h. AND DX,32. What does DX equal?
5. MOV AX,20h. INC AH. What does AX equal?
6. MOV AL,20h. MUL 32. What does AX equal?
7. MOV AX,3242h. PUSH AX. MOV AL,SS. What is AL?
8. What does JMP FAR 0FFF0h:0F000h do on the XT?
9. MOV AX,3. INT 10h. What does this do?
10. MOV AX,4C00h. INT 21h. What does this do?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

purifier

Thank you so much for your time. And yes, I think I misunderstood "help". I realise it now. I wish you were still online to tell me how i did...Please tell me if I've done something wrong, because I've been learning the concepts in my home itself.

1. MOV 16 into AX then SHL AX,1. What does AX equal?
AX would be 20h. 16 in decimal will be converted into 10h and then shifted left. So AX would possess 32 in decimal

2. CX=57h. ADD CL,99h. What does CX equal?
CX would contain 0F0H

3. CX=57h. ADC CX,99h. What does CX equal?
CX would still contain 0F0H

4. DX=20h. AND DX,32. What does DX equal?
DX would contain 20h

5. MOV AX,20h. INC AH. What does AX equal?
AX would equal 120H

6. MOV AL,20h. MUL 32. What does AX equal?
AX would be 400H

7. MOV AX,3242h. PUSH AX. MOV AL,SS. What is AL?
No Idea. I just got a doubt. Is that SP?

8. What does JMP FAR 0FFF0h:0F000h do on the XT?
I think XT manages the translation and executes a FAR jump

9. MOV AX,3. INT 10h. What does this do?
Something to do with the BIOS service

10. MOV AX,4C00h. INT 21h. What does this do?
Calls the DOS Interrupt - Exit to DOS

And yeah, this is not a Job Interview - I forgot to mention but a University Interview for promotion into the next semester  ::)

Mark Jones

Pretty good. :)

2: note it is ADD CL and not ADD CX.
7: is this a valid instruction?
8: ok but what does the instruction do? :bg
9: try looking up interrupts in Ralf Brown's Interrupt List.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

purifier

2: note it is ADD CL and not ADD CX.
Automatic Correction inside my brain.. :)

7: is this a valid instruction?
I don't think so. Hmm... no i'm sure...

8: ok but what does the instruction do?
:bg Pushes the current code segment and IP and flags ito the stack and loads the new CS and IP. Is that it?

9: try looking up interrupts in Ralf Brown's Interrupt List.
Thanks... Reading now... But are we supposed to all of them  :dazzled:

asmfan

Mark,
could you give a link to those interesting tests? I gonna test my fellows;)
By the way isn't 8. a cold reboot?
Russia is a weird place

MichaelW

Quote
AX would be 20h. 16 in decimal will be converted into 10h and then shifted left.
The registers contain binary values stored as bits. Decimal and hexadecimal are just representations of the binary values that most humans find easier to read and understand.

For 8, the destination address, which I would express as F000:FFF0 because the BIOS is effectively located at segment address F000h, is the BIOS power-up entry point. For older systems, and for newer systems running in real mode, a jump to this address would cause the BIOS to do what it would do at system power-up, but without the processor being reset.

Several more, for the 8086/8088 processors:

Describe the register set, what each register is used for, and any specialized uses. Include the flags register and what each flag indicates or controls.

Describe how the stack works, including a description of what the push and pop instructions do.

Describe how near and far calls, unconditional jumps, conditional jumps, and hardware and software interrupts work.

eschew obfuscation

Mark Jones

Quote from: asmfan on April 20, 2006, 07:43:26 PM
could you give a link to those interesting tests? I gonna test my fellows;)

Sorry, I made those questions up. :bg

Quote
By the way isn't 8. a cold reboot?

Bingo! :U

There is a lot more to it, but that's the final call to the BIOS (on an XT system.)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

MichaelW

A "cold" boot would necessarily reset the processor. On older systems, but obviously not the earliest systems, most 386 memory managers and some versions of Windows would effectively replace the instructions at the power-up entry point so they could take control and reset the processor to ensure, as a minimum, that the processor returned to real mode. Otherwise, and for older systems (I have not actually tested this on recent systems) simply jumping to this address will not reset the processor.


eschew obfuscation

Mark Jones

Well "cold boot" in #8 is not technically correct, it would be a "warm boot" I guess. Dunno, I have an AT. :toothy

Ex: http://www.frontiernet.net/~fys/reboot.htm
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

purifier

QuoteDescribe the register set, what each register is used for, and any specialized uses. Include the flags register and what each flag indicates or controls.

Describe how the stack works, including a description of what the push and pop instructions do.

Describe how near and far calls, unconditional jumps, conditional jumps, and hardware and software interrupts work.

Great questions... Thank you... I just finished the test... I was asked:

What are the different registers present in the Interrupt Controller 8259 and how do you interface it to the 8086...

What is the difference between a Microprocessor and a Microcontroller...

While connecting the 8255 to 8086...what lines do you use?

What is the function of IMR?

And a few more similar questions...they'll be easy for people here... I'm still a beginner... But i answered all of them  :bg Guess I'll top that... :U

Roger

Mark,

I think cold boot is correct as this is the start point for 'power_on' initialisation and initialises the POST (power on system test)which preceeds bios.sys loading. Warm boot, depending on the particular system, takes you to a later point in the start-uip after POST and often after bios.sys is loaded.

However the real question is:-

8. What does JMP FAR 0FFF0h:0F000h do on the XT?

The answer is  it crashes because   0FFF00 + 0F000 = 10FEF0

The wrap round segment boundaries depended on the particular chip in use. On some this would be 0000:0FEF0 on others it would try to be 0FFF0:0FEF0 which would still cross the boundary.

FWIW
I found this out about 8 years ago. A company I had worked for asked me as a consultant to upgrade a processor card which I had designed. Specificaly I had to replace the 8188 chip with a 8188EM which was 4 times faster (40MHz) and put in more RAM (0.5MByte). All was fine and it worked with my original code. Howerver the new code they wanted to run on it crashed although it ran on my old cards. The problem was that they had changed from assembler to Forth, and used a ROM Forth in a 32K PROM at 0F800:0000 segment wrapping round to 0000:7FFF thus getting both RAM amd PROM in the same segment. The new processor did not wrap round to 0000:0000 with inevitable results.

BTW
I still use the old cards to run my model railway and it actually has the correct instructions  jmp 0F800:07FF0 and jmp 0F800:07F00  for cold and warm restarts.

Regards Roger