Changeset 45 for trunk/INCLUDE/ASM.INC


Ignore:
Timestamp:
Apr 12, 2014, 12:36:45 AM (11 years ago)
Author:
Ben Rietbroek
Message:

Now using compressed HidePartTable (auxdebug on) [2012-02-24]

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can DESTROY THE MBR on ALL ATTACHED DISKS!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE THESE COMMITS!!

Fixes

o HidePartTabled now uses a 6-bit compressed format

Bitfield functions are used to manipulate the table.
Modifications mostly in PARTSCAN.ASM, PART_SET.ASM and PARTMAIN.ASM.
TODO: Determine impact on upgrading from previous versions.

Changes

o Changed LVM Label behavior

If they are the same, the LVM VolumeName is synced to LVM PartitionName
so they are the same again after the edit.
If they differ, only the LVM VolumeName is updated.

o Implemented stop scanning when partition limit of 45 is exceeded

User is presented with a warning pop-up.
Pressing a key will continue and the partitions that were found
so far are displayed in the menu.
The color of the selection bar is changed to red to indicate this
overflow situation.

o New overlap macro that works correctly with JWasm and Tasm

Now uses DB n DUP (<filler>) to fill space before a new ORG.
When overlap occurs n goes negative causing assembler error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/INCLUDE/ASM.INC

    r43 r45  
    3030EndM
    3131
    32 callfar Macro destination
    33    push    cs
    34    call    &destination
    35 EndM
     32
     33; Rousseau:
     34; My editor (Geany) keeps auto-completing 'call' to 'callfar' because
     35; of this definition. Since it's not used anywhere I disabled it.
     36;~ callfar Macro destination
     37   ;~ push    cs
     38   ;~ call    &destination
     39;~ EndM
    3640
    3741
    3842;
    39 ; An ORG directive resets the location counter where code and data is
    40 ; generated. If the location counter is reset back to a point where
    41 ; code or data already has been generated, this will be overwritten
    42 ; without warning.
    43 ; This macro can be used with every ORG directive to check for this condition,
    44 ; and when it occurs further assembly is terminated.
    45 
     43; OLD OVERLAP CHECKER, DOES NOT WORK WELL WITH JWASM.
     44;
    4645; NOTE:  Overlapchecking in JWasm is not as reliable as in Tasm.
    4746;        Because it's a single pass assembler, the current location can be
     
    9190    ; Terminate assembly by forcing an error.
    9291    .ERR
     92ENDM
    9393
     94
     95;
     96; A normal ORG directive resets the location counter where code and data is
     97; going to be emitted. If the location counter is reset back to a point
     98; where code or data already has been emitted, this will be overwritten
     99; without warning.
     100; This macro does a check for this condition and aborts if it exists.
     101; If there is space between the new location and the last emitted code or data
     102; will be filled.
     103;
     104; There are differences between assemblers on when and how labels and values
     105; are evaluated. Since JWasm is a single-pass assembler, some expressions
     106; do not work that do work in multi-pass Tasm.
     107; That's why the actual check for overlap is done by db getting a negative
     108; value if an overlap occured.
     109; So don't change the (after - before) calculations by assigning it to a
     110; variable; that will break this macro.
     111;
     112ORIGIN  MACRO   loc
     113    ;~ IFDEF   JWASM
     114        ;~ db  (@F - $)   dup('X')
     115        ;~ ORG     loc
     116        ;~ @@:
     117    ;~ ENDIF
     118
     119    ; Use this value to fill the gap between the new origin and the last
     120    ; emitted code or data.
     121    fillchar = 'X'
     122
     123    ; Mark the location of the last emitted code or data.
     124    z_&loc&_1before:
     125
     126    ; JWasm can do db 0 dup (0).
     127    IFDEF   JWASM
     128        db  (z_&loc&_2after - z_&loc&_1before)   dup(fillchar)
     129    ENDIF
     130
     131    ; Tasm cannot.
     132    IFDEF   TASM
     133        IF (z_&loc&_2after - z_&loc&_1before) NE 0
     134            db  (z_&loc&_2after - z_&loc&_1before)   dup(fillchar)
     135        ENDIF
     136    ENDIF
     137
     138    ; Set the new origin.
     139    ORG     loc
     140
     141    ; Mark the new location.
     142    z_&loc&_2after:
     143
     144    ; Calculate the gap.
     145    z_&loc&_3gap = z_&loc&_2after - z_&loc&_1before
     146
     147    ;
     148    ; Note that the variables are prefixed with z_ so they appear
     149    ; at the end of the list-file.
     150    ;
    94151ENDM
     152
    95153
    96154
Note: See TracChangeset for help on using the changeset viewer.