Introduction to Machine And Assembly Language - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Introduction to Machine And Assembly Language

Description:

... And Assembly Language. 32-Bit Windows Programming: GUI. Dr. Richard Ford ... WNDCLASS: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 12
Provided by: richar134
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Machine And Assembly Language


1
Introduction to Machine And Assembly Language
  • 32-Bit Windows Programming GUI
  • Dr. Richard Ford

2
Okay
  • So, we can call random Win32 functions from
    assembly language
  • Thats nice
  • But lets do some graphical output

3
Displaying a Window
  • There are two ways we can do this look at the
    functions and then look at the program
  • Or look at the program and then look at the
    functions
  • Well take option B.

4
WinMain
  • All Windows applications startup with a
    procedure, usually called WinMain
  • Get a handle to the current program
  • Load the programs icon
  • Register the main window class and set up an
    event handler
  • Create a window
  • Show and update this window
  • Begin a loop to handle messages

5
GetModuleHandle
  • Look at http//msdn.microsoft.com/library/default
    .asp?url/library/en-us/dllproc/base/getmodulehand
    le.asp
  • So, what does it do in this context?

6
MainWin.hInstance
  • WNDCLASS http//msdn.microsoft.com/library/defaul
    t.asp?url/library/en-us/winui/winui/windowsuserin
    terface/windowing/windowclasses/windowclassreferen
    ce/windowclassstructures/wndclass.asp
  • So, how can we use it? What is the PROTO?

7
More
  • Look up these in context
  • LoadIcon
  • LoadCursor
  • RegisterClass
  • CreateWindowEx
  • Basically, lets look up each call one after
    another
  • Now trace through it in NTSD

8
IA-32 Memory Management
  • Understanding how
  • Translating logical addresses into linear
    addresses
  • Translating linear addresses into physical
    addresses (paging)

9
Two new terms
  • Segment Selector a 16-bit value stored in a
    segment register
  • CS, DS, ES, FS, GS (ooh, new registers!)
  • Logical Address combination of a segment
    selector and a 32-bit offset

10
How can two programs both access
  • Imagine we run the same program in two different
    windows
  • They both store something at 404000h. How?
  • Answer this address is mapped to a linear address

11
Linear Address
  • Combines selector and offset to compute a linear
    address
  • 32-bit Integer
  • Converted to a physical address by the OS
  • May need to be loaded from a page file this is
    a page fault
  • Look in task manager!
  • Important to understand when you really do
    low-level stuff (wait and see ?)
Write a Comment
User Comments (0)
About PowerShow.com