patchGNU MIX Development Kit - Patches: patch #9773, Make addr 3999 accessible to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9773: Make addr 3999 accessible to device IO

Submitter:  Kevin Brunelle <brunk23>
Submitted:  Tue 19 Mar 2019 12:48:07 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  jao Open/Closed:  Open

Tue 19 Mar 2019 01:15:16 AM UTC, comment #1: 

Thanks Kevin, you're right.  I've pushed your patch to the master branch and it'll be part of version 1.2.11.

Jose Antonio Ortega Ruiz <jao>
Group administrator
Tue 19 Mar 2019 12:48:07 AM UTC, original submission:  

It is impossible to read from a device into the highest word of memory in the VM. It is also impossible to output the highest word of memory to a device.

Replication: The following examples demonstrate this error.
IN 3900(8)
OUT 3900(8)
IN 3984(16)
OUT 3984(17)

This is an error in the following test.
MEM_CELLS_NO_ - addr > mix_device_block_size (dev)

We can read/write 100 words at location 3900 (3900-3999). This is easily fixed by changing the condition to >=.

I have included a patch below and attached it to this report.

Thanks,
Kevin Brunelle


diff --git a/mixlib/xmix_vm.c b/mixlib/xmix_vm.c
index cf20ee1..8735962 100644
--- a/mixlib/xmix_vm.c
+++ b/mixlib/xmix_vm.c
@@ -333,7 +333,7 @@ inp_handler_ (mix_vm_t *vm, const mix_ins_t *ins)
   dev = get_dev_ (vm, ins->fspec);
   fail_if_not_ (vm, dev != NULL, MIX_VM_ERROR_BAD_DEVICE_NO);
 
-  fail_if_not_ (vm, MEM_CELLS_NO_ - addr > mix_device_block_size (dev),
+  fail_if_not_ (vm, MEM_CELLS_NO_ - addr >= mix_device_block_size (dev),
                 MIX_VM_ERROR_BAD_ACCESS);
 
   fail_if_not_ (vm, mix_device_read (dev, get_cell_ptr_ (vm, addr)),
@@ -359,7 +359,7 @@ out_handler_ (mix_vm_t *vm, const mix_ins_t *ins)
   dev = get_dev_ (vm, ins->fspec);
   fail_if_not_ (vm, dev != NULL, MIX_VM_ERROR_BAD_DEVICE_NO);
 
-  fail_if_not_ (vm, MEM_CELLS_NO_ - addr > mix_device_block_size (dev),
+  fail_if_not_ (vm, MEM_CELLS_NO_ - addr >= mix_device_block_size (dev),
                 MIX_VM_ERROR_BAD_ACCESS);
 
   fail_if_not_ (vm, mix_device_write (dev, get_cell_ptr_ (vm, addr)),


Kevin Brunelle <brunk23>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #46575:  patch.txt added by brunk23 (992B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jao (Posted a comment)
  • -email is unavailable- added by brunk23 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-19 jao StatusNone Done
        Assigned toNone jao
    2019-03-19 brunk23 Attached File- Added patch.txt, #46575

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code